package com.yihuan.service;

import com.yihuan.entity.CompanyEntity;
import com.yihuan.mapper.CompanyMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Author:梦醒
 * Date: 2022/4/18 20:54
 * Dream:
 * 信言不美，美言不信。
 * 善者不辩，辩者不善。
 * 知者不博，博者不知。
 * Function:
 */
@Service
public class CompanyService {
    @Resource
    CompanyMapper companyMapper;
    
    /**
     * 查询店铺名称是否注册过
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompName(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompName(companyEntity);
    }
    
    /**
     * 根据公司名称状态未通过
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompNameAndCompState(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompNameAndCompState(companyEntity);
    }
    
    /**
     * 根据公司编号是否存在
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompIDAndCompCode(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompIDAndCompCode(companyEntity);
    }
    
    /**
     * 查询店铺名称是否注册过
     *
     * @param companyEntity
     * @return
     */
    public int insertCompanyByCompanyData(CompanyEntity companyEntity) {
        return companyMapper.insertCompanyByCompanyData(companyEntity);
    }
    
    /**
     * 分页查询数据
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompanyList(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompanyList(companyEntity);
    }
    
    /**
     * 统计分页查询数据
     *
     * @param
     * @return
     */
    public int countCompanyList() {
        return companyMapper.countCompanyList();
    }
    
    /**
     * 模糊分页查询数据
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompanyConcatList(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompanyConcatList(companyEntity);
    }
    
    /**
     * 模糊统计分页查询数据
     *
     * @param companyEntity
     * @return
     */
    public int countCompanyConcatList(CompanyEntity companyEntity) {
        return companyMapper.countCompanyConcatList(companyEntity);
    }
    
    /**
     * 更改商铺信息状态
     *
     * @param companyEntity
     * @return
     */
    public int updateCompanyByCompState(CompanyEntity companyEntity) {
        return companyMapper.updateCompanyByCompState(companyEntity);
    }
    
    /**
     * 查询按公司编号
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompID(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompID(companyEntity);
    }
    
    /**
     * 注册密钥
     *
     * @param companyEntity
     * @return
     */
    public int updateCompanyByCompStateAndCode(CompanyEntity companyEntity) {
        return companyMapper.updateCompanyByCompStateAndCode(companyEntity);
    }
    
    /**
     * 前端分页查询数据
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompanyListAndCompState(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompanyListAndCompState(companyEntity);
    }
    
    /**
     * 前端统计分页查询数据
     *
     * @return
     */
    public int countCompanyListAndCompState() {
        return companyMapper.countCompanyListAndCompState();
    }
    
    
    /**
     * 前端分页查询数据  按地址
     *
     * @param companyEntity
     * @return
     */
    public List<CompanyEntity> findCompanyByCompanyListAndCountryID(CompanyEntity companyEntity) {
        return companyMapper.findCompanyByCompanyListAndCountryID(companyEntity);
    }
    
    /**
     * 前端统计分页查询数据 按地址
     *
     * @return
     */
    public int countCompanyListAndCountryID(CompanyEntity companyEntity) {
        return companyMapper.countCompanyListAndCountryID(companyEntity);
    }
}
